package org.linlinjava.litemall.wx.service;

import com.github.pagehelper.PageHelper;
import org.linlinjava.litemall.core.util.ResponseUtil;
import org.linlinjava.litemall.db.dao.LitemallUserMemberMapper;
import org.linlinjava.litemall.db.domain.LitemallUserMember;
import org.linlinjava.litemall.db.domain.LitemallUserMemberExample;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;

import javax.annotation.Resource;
import java.util.List;
/**
 * @author Administrator
 */
@Service
public class WxUserMemberService {
    @Resource
    private LitemallUserMemberMapper userMemberMapper;

    /**
     * 展示登录用户获得的会员
     * @param userId
     * @return
     */
    public LitemallUserMember findByUserId(Integer userId) {
        LitemallUserMemberExample userMemberExample = new LitemallUserMemberExample();
        userMemberExample.or().andUserIdEqualTo(userId).andEffectiveEqualTo(true).andDeletedEqualTo(false);
        return userMemberMapper.selectOneByExample(userMemberExample);
    }



}
